//弹窗
package EXample;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

import static java.lang.Thread.sleep;

public class page04 {
    public static void main(String[] args) throws InterruptedException {
        WebDriver webDriver=new ChromeDriver();
        webDriver.get("http://localhost:63342/TEST02/EXample/Test04.html?_ijt=dqiokqtocrt6b39qnr6sji2fma&_ij_reload=RELOAD_ON_SAVE");
        webDriver.findElement(By.cssSelector("body > button")).click();
        String name="珊珊";
        //弹窗输入
        webDriver.switchTo().alert().sendKeys(name);
        sleep(3000);
        //弹窗确认
        webDriver.switchTo().alert().accept();
        sleep(3000);
        String s=webDriver.findElement(By.cssSelector("body > div:nth-child(4)")).getText();
        System.out.println(s);


    }
}
